package net.starwifi.duobao.utils.wx;



import net.starwifi.duobao.utils.HttpUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2016/3/14 0014.
 */
public class WXCoreAPI {

    public static String getToken(String appKey,String appSecret){
        String baseUrl="https://api.weixin.qq.com/cgi-bin/token";
        Map<String,Object> params=new HashMap<String, Object>();
        params.put("grant_type","client_credential");
        params.put("appid",appKey);
        params.put("secret",appSecret);
        return HttpUtils.get(baseUrl, params);
    }

    public static String getJsTicket(String accessToken,String type){
        String baseUrl="https://api.weixin.qq.com/cgi-bin/ticket/getticket";
        Map<String,Object> params=new HashMap<String, Object>();
        params.put("access_token",accessToken);
        params.put("type",type);
        return HttpUtils.get(baseUrl, params);
    }


}
